import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class ClassProp extends Component {
    // 限定外部数据类型
    static propTypes = {
        name:PropTypes.string.isRequired,
        age:PropTypes.number
    }
    // 默认值
    static defaultProps = {
        age:99
    }
    render() {
        let {name, age} = this.props;
        return (
            <div>
                <h3>类组件</h3>
                <p>props name : {name}</p>
                <p>props  age: {age}</p>
            </div>
        )
    }
}
